import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/drnbill_name_entity.dart';

DrnbillNameEntity $DrnbillNameEntityFromJson(Map<String, dynamic> json) {
  final DrnbillNameEntity drnbillNameEntity = DrnbillNameEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    drnbillNameEntity.id = id;
  }
  final String? nameZh = jsonConvert.convert<String>(json['nameZh']);
  if (nameZh != null) {
    drnbillNameEntity.nameZh = nameZh;
  }
  final String? nameEn = jsonConvert.convert<String>(json['nameEn']);
  if (nameEn != null) {
    drnbillNameEntity.nameEn = nameEn;
  }
  final String? nameTha = jsonConvert.convert<String>(json['nameTha']);
  if (nameTha != null) {
    drnbillNameEntity.nameTha = nameTha;
  }
  return drnbillNameEntity;
}

Map<String, dynamic> $DrnbillNameEntityToJson(DrnbillNameEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['nameZh'] = entity.nameZh;
  data['nameEn'] = entity.nameEn;
  data['nameTha'] = entity.nameTha;
  return data;
}

extension DrnbillNameEntityExt on DrnbillNameEntity {
  DrnbillNameEntity copyWith({
    String? id,
    String? nameZh,
    String? nameEn,
    String? nameTha,
  }) {
    return DrnbillNameEntity()
      ..id = id ?? this.id
      ..nameZh = nameZh ?? this.nameZh
      ..nameEn = nameEn ?? this.nameEn
      ..nameTha = nameTha ?? this.nameTha;
  }
}